package net.mihome.app.bean.net;

import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Created by ZHAO on 2014/8/20 0020.
 */
public class GsonUtils<T> {
    public ResponsePojo<T> fromJson(String json){
        Type type=new TypeToken<ResponsePojo<T>>() {}.getType();
        return  new Gson().fromJson(json, type);
    }
    
    public Integer double2int(Object o){
        Double db=(Double)o;
        return db.intValue();
    }
}
